FIG. 1 is a schematic functional block diagram illustrating a conventional storage device. As shown in FIG. 1, the storage device 10 is in communication with a host 12 in order for receiving a read command or a write command from the host 12. For example, the host 12 is a computer host, and the storage device 10 is a hard disc drive or an optical drive.
The storage device 10 comprises a controlling unit 101, a cache memory 103, and a storage element 105. The controlling unit 101 is in communication with the host 12 through an external bus 20. Consequently, commands and data can be exchanged between the controlling unit 101 and the host 12. According to a command from the host, the controlling unit 101 may access the data of the storage element 105. Moreover, the cache memory 103 is connected with the controlling unit 101 in order for temporarily storing the write data from the host 12 or the read data requested by the host 12.
Generally, the external bus 20 may be a USB bus, an IEEE 1394 bus, an SATA bus, or the like. The storage element 105 is an optical disc or a magnetic disc.
As is well known, the cache memory 103 is used for temporarily storing the write data from the host 12 or the read data requested by the host 12. For example, in case that the host 12 issues the write command and the corresponding write data to the storage device 10, the write command and the corresponding write data are temporarily stored into the cache memory 103 by the controlling unit 101, and then the write data is processed (e.g. generation of ECC code) and stored into the storage element 105 by the controlling unit 101. Whereas, in case that the host 12 issues the read command to the storage device 10, the read data from the storage element 105 is temporarily stored into the cache memory 103 by the controlling unit 101, and then the read data is transmitted to the host 12 by the controlling unit 101.
From the above discussions, the cache memory 103 is used for temporarily storing the write data (i.e. for a writing purpose) when the host 12 issues the write command; and the cache memory 103 is used for temporarily storing the read data (i.e. for a reading purpose) when the host 12 issues the read command.
Recently, a novel storage device such as a solid state drive (SSD) is introduced into the market and becomes more popular. The solid state drive has the tendency to gradually replace the hard disc drive or the optical drive.
Generally, the solid state drive is a storage device that uses a NAND-based flash memory as a storage element. The NAND-based flash memory is a non-volatile memory. After a data is written to the flash memory, if the systematic power is turned off, the data is still retained in the solid state drive.
Since the storage element of the solid state drive is distinguished, the cache memory of the solid state drive should have a specially-designed managing mechanism in order to enhance the operating efficiency of the solid state drive.